﻿<local:DocumentBase x:Class="WPFExcelReport.QCORDER"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="质检单"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch"
>
    <local:DocumentBase.Resources>
        <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <Expander x:Name="exp" IsExpanded="True"
                          Background="White"
                          Foreground="Black">
                            <Expander.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=ARTICLE}" />
                                    <TextBlock Text="{Binding Path=ItemCount}"/>
                                    <TextBlock Text="Items"/>
                                </StackPanel>
                            </Expander.Header>
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource  x:Key="FlickrGroupedFeed" Source="{Binding Path=WBBEW,Source={StaticResource iNTEXDataSet}}">
        </CollectionViewSource>
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="600" />
            <ColumnDefinition Width="400" />
        </Grid.ColumnDefinitions>

        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel >
                <Label Content="缸号" Height="30" HorizontalAlignment="Left" Margin="5,16,0,0" Name="label3" VerticalAlignment="Top" FontSize="18" Width="46" />
                <TextBox Height="30" HorizontalAlignment="Right" Margin="5,10,0,0" Name="LOT" VerticalAlignment="Top" Width="119" FontSize="18" 
                         BorderBrush="#FF2E2A2A" Background="#FFF2E6E6" CharacterCasing="Upper" KeyboardNavigation.TabIndex="1" />
                <Label Content="品种" Height="30" HorizontalAlignment="Left" Margin="5,16,0,0" Name="label4" VerticalAlignment="Top" FontSize="18" Width="45" />
                <TextBox Height="30" HorizontalAlignment="Right" Margin="5,10,0,0" Name="ARTICLE" VerticalAlignment="Top" Width="139" FontSize="18" 
                         BorderBrush="#FF2E2A2A" Background="#FFF2E6E6" CharacterCasing="Upper" KeyboardNavigation.TabIndex="2" />
                <Label Content="生产单号："    Width="80" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF140D0D" />
                <TextBox Name="txtFKRS" Width="41" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" FontSize="18" Text="" Height="30" Foreground="#FF140D0D" 
                         KeyboardNavigation.TabIndex="3" CharacterCasing="Upper" MaxLength="2" />
                <TextBox Name="txtFLFD" Width="80" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Beige" Text="" FontSize="18" Height="30" Foreground="#FF140D0D" 
                         KeyboardNavigation.TabIndex="4" CharacterCasing="Upper" MaxLength="6" />
                <TextBox Name="txtFPOS" Width="40" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="" Height="30" Foreground="#FF140D0D" 
                         KeyboardNavigation.TabIndex="5" CharacterCasing="Upper" MaxLength="3" />
                <Button  Content="查询"  Height="23" Margin="10,0,0,0"  Name="btnQuery" Width="75" Click="btnQuery_Click" KeyboardNavigation.TabIndex="6" />
                <Button Content="导出EXCEL" Margin="10,0,0,0"   Height="23"   Name="btnReport" Width="75" Click="btnReport_Click" KeyboardNavigation.TabIndex="7" />

            </WrapPanel>
            <WrapPanel>
                <Label Content="日期从" Height="26" HorizontalAlignment="Left" Margin="10,16,0,0" Name="label1" VerticalAlignment="Top" Width="62" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="10,10,0,0" Name="FROM_INSPECTION_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="FROM_INSPECTION_DATE_SelectedDateChanged" Width="95" />
                <Label Content="至" Height="28" HorizontalAlignment="Left" Margin="10,16,0,0" Name="label2" VerticalAlignment="Top" Width="19" FontSize="18" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,10,0,0" Name="END_INSPECTION_DATE" VerticalAlignment="Top" 
                                SelectedDateChanged ="END_INSPECTION_DATE_SelectedDateChanged" Width="95" />
            </WrapPanel>
        </StackPanel>
        <WrapPanel Grid.Row="2"  Grid.Column="0"  Grid.ColumnSpan="2">
            <fd:FilteringDataGrid 
                AutoGenerateColumns="False" EnableRowVirtualization="True"  ItemsSource="{Binding}" HeadersVisibility="Column" x:Name="MasterDg" 
                                             CanUserReorderColumns="True"  CanUserResizeColumns="True" CanUserSortColumns="True" IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="Auto"
                                              Height="500"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
                <DataGrid.Columns>
                    <!--QCORDER,A.QOKNEUD,A.QOKERLDAT,A.QOKSTATUS,A.QOKRESULT, QPLAN,A.QOKPRODPART,A.QOKARTST, ARTICLE,VORDER,TP, KORDER,-->
                    <DataGridTextColumn Binding="{Binding Path=QCORDER}" Header="质检单号" Width="SizeToCells" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=QOKNEUD}" Header="开单日期" Width="SizeToCells"  MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=QOKERLDAT}" Header="完成日期"  Width="SizeToCells"  MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=QOKGEBINDE}" Header="入库日期"  Width="SizeToCells"  MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=QOKSTATUS}" Header="订单状态"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=QOKRESULT}" Header="订单结果"  Width="SizeToCells"  MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=QPLAN}" Header="质检计划"  Width="SizeToCells"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=QOKPRODPART}" Header="缸号"  Width="SizeToCells"  MinWidth="70"/>
                    <DataGridTextColumn Binding="{Binding Path=QOKKUNDPART}" Header="批次"  Width="SizeToCells"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=QOKARTST}" Header="物料类"  Width="SizeToCells"  MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="品种"  Width="SizeToCells"  MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=COLORDES}" Header="颜色/后整理"  Width="SizeToCells"  MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=VORDER}" Header="生产单"  Width="SizeToCells"  MinWidth="70"/>
                    <DataGridTextColumn Binding="{Binding Path=FACTORY}" Header="外加工厂"  Width="SizeToCells"  MinWidth="60"/>
                    <DataGridTextColumn Binding="{Binding Path=TP}" Header="生产批次"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=KORDER}" Header="销售单"  Width="SizeToCells"  MinWidth="70"/>
                    <DataGridTextColumn Binding="{Binding Path=JS}" Header="经缩%"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=WS}" Header="纬缩%"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=XQMF}" Header="洗前门幅cm"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=XHMF}" Header="洗后门幅cm"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=QMQ}" Header="起毛起球grd"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=GMC}" Header="干摩擦grd"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=SMC}" Header="湿摩擦grd"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=KZ}" Header="克重g/m2"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=BJSP}" Header="洗先经向撕破n"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=AJSP}" Header="洗后经向撕破n"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=BWSP}" Header="洗前纬向撕破n"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=AWSP}" Header="洗后纬向撕破n"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=WX}" Header="纬移cm"  Width="SizeToCells"  MinWidth="30"/>
                    <DataGridTextColumn Binding="{Binding Path=XHWY}" Header="洗后纬移cm"  Width="SizeToCells"  MinWidth="30"/>
                </DataGrid.Columns>
            </fd:FilteringDataGrid>
        </WrapPanel>
    </Grid>
</local:DocumentBase>
